Skip to content

fix(@ngtools/webpack): JIT mode CommonJS accessing inexistent default property - #22247

Merged
dgp1130 merged 1 commit into
angular:masterfrom
alan-agius4:cjs
Nov 29, 2021
Merged

fix(@ngtools/webpack): JIT mode CommonJS accessing inexistent default property#22247
dgp1130 merged 1 commit into
angular:masterfrom
alan-agius4:cjs

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

With this change we fix an issue in JIT mode were we try to access an inexistent default property of styles modules when emitted in CJS.

Also, we now emit templates modules without the default property when not targeting ES2015 or greater to normalize the how to require templates and styles.

Closes #21588

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Nov 29, 2021
@google-cla google-cla Bot added the cla: yes label Nov 29, 2021
…t` property

With this change we fix an issue in JIT mode were we try to access an inexistent `default` property of styles modules when emitted in CJS.

Also, we now emit templates modules without the default property when not targeting ES2015 or greater to normalize the how to `require` templates and styles.

Closes #21588
@alan-agius4
alan-agius4 requested a review from dgp1130 November 29, 2021 17:50
Comment thread packages/ngtools/webpack/src/transformers/replace_resources.ts
@alan-agius4 alan-agius4 self-assigned this Nov 29, 2021
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Nov 29, 2021
@dgp1130
dgp1130 merged commit b3f71c5 into angular:master Nov 29, 2021
@alan-agius4
alan-agius4 deleted the cjs branch November 29, 2021 18:40
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Dec 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@angular-devkit/build-angular 12.2.1 unit test failures - TypeError: Cannot read property 'match' of undefined

2 participants